package org.springframework.cloud.openfeign;

import java.util.List;

import com.exin.openfeign.config.FeignNameConvertProperties;

public class FeignClientReduceFactoryBean extends FeignClientFactoryBean{

	@Override
	public void afterPropertiesSet() throws Exception {
		super.afterPropertiesSet();
		FeignNameConvertProperties prop = this.getApplicationContext().getBean(FeignNameConvertProperties.class);
		List<String> list = prop.getExcludeConversions();
		if(list!=null) {
			if(list.contains(this.getName())) {
				return ;
			}
		}
		String newname = prop.getConversions().get(this.getName());
		if(newname == null) {
			newname = prop.getDefaultConversion();
		}
		if(newname != null) {
			super.setName(newname);
		}
	}
	
}
